﻿@model ProductDetailsModel
@using Nop.Core.Domain.Seo;
@using Nop.Core.Infrastructure;
@using Nop.Web.Models.Catalog;
@{
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";

    //title, meta
    Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Name);
    Html.AddMetaDescriptionParts(Model.MetaDescription);
    Html.AddMetaKeywordParts(Model.MetaKeywords);

    var canonicalUrlsEnabled = EngineContext.Current.Resolve<SeoSettings>().CanonicalUrlsEnabled;
    if (canonicalUrlsEnabled)
    {
        var productUrl = Url.RouteUrl("Product", new { SeName = Model.SeName }, this.Request.Url.Scheme);
        Html.AddCanonicalUrlParts(productUrl);
    }
}
<!--product breadcrumb-->

@Html.Action("ProductBreadcrumb", "Catalog", new { productId = Model.Id })

<div class="page product-details-page panel panel-default form-panel">

    <div class="panel-heading">
        <h3>@Model.Name</h3>
    </div>
    <div class="panel-body">
        @Html.Widget("productdetails_top")
        @using (Html.BeginRouteForm("Product", new { SeName = Model.SeName }, FormMethod.Post, new { id = "product-details-form" }))
        {
            <div itemscope itemtype="http://schema.org/Product" data-productid="@Model.Id">
                <div class=" product-essential">
                    @Html.Widget("productdetails_before_pictures")
                    <!--product pictures-->
                    <div class="col-md-6">
                        @Html.Partial("_ProductDetailsPictures", Model)
                        @Html.Widget("productdetails_after_pictures")
                    </div>

                    <div class="col-md-6 overview ">
                        @*<div class="product-name">
                            <h1 itemprop="name">
                                @Model.Name
                            </h1>
                        </div>*@
                        @if (!String.IsNullOrEmpty(Model.ShortDescription))
                        {
                            <div class="short-description">
                                @Html.Raw(Model.ShortDescription)
                            </div>
                        }
                        @Html.Widget("productdetails_overview_top")
                        <!--product SKU, manufacturer part number, stock info-->
                        @Html.Partial("_SKU_Man_Stock", Model)
                        <!--Back in stock subscription-->
                        @Html.Partial("_BackInStockSubscription", Model)
                        <!--product manufacturers-->
                        @Html.Action("ProductManufacturers", "Catalog", new { productId = Model.Id })
                        <!--product reviews-->
                        @Html.Action("ProductReviewOverview", "Catalog", new { productId = Model.Id })
                        <!--sample download-->
                        @Html.Partial("_DownloadSample", Model)
                        <!--attributes-->
                        @{
                            var dataDictAttributes = new ViewDataDictionary();
                            dataDictAttributes.TemplateInfo.HtmlFieldPrefix = string.Format("attributes_{0}", Model.Id);
                            @Html.Partial("_ProductAttributes", Model.ProductVariantAttributes, dataDictAttributes)                  
                        }
                        <!--gift card-->
                        @{
                            var dataDictGiftCard = new ViewDataDictionary();
                            dataDictGiftCard.TemplateInfo.HtmlFieldPrefix = string.Format("giftcard_{0}", Model.Id);
                            @Html.Partial("_GiftCardInfo", Model.GiftCard, dataDictGiftCard)
                        }
                        <!--price & add to cart-->
                        @{
                            var dataDictPrice = new ViewDataDictionary();
                            dataDictPrice.TemplateInfo.HtmlFieldPrefix = string.Format("price_{0}", Model.Id);
                            @Html.Partial("_ProductPrice", Model.ProductPrice, dataDictPrice)
                            
                            var dataDictAddToCart = new ViewDataDictionary();
                            dataDictAddToCart.TemplateInfo.HtmlFieldPrefix = string.Format("addtocart_{0}", Model.Id);
                            @Html.Partial("_AddToCart", Model.AddToCart, dataDictAddToCart)                    
                        }
                        <div class= "form-group row">
                            @Html.Action("ProductEmailAFriendButton", "Catalog", new { productId = Model.Id })

                            @Html.Action("CompareProductsButton", "Catalog", new { productId = Model.Id })
                        </div>
                        @Html.Action("ShareButton", "Catalog")
                        @Html.Widget("productdetails_overview_bottom")
                    </div>



                    <ul class="nav nav-tabs">
                        @if (!String.IsNullOrEmpty(Model.FullDescription))
                        {
                          
                            <li class="active"><a href="#description" data-toggle="tab">Description</a></li>
                        }
                        @if (!String.IsNullOrEmpty(@Html.Action("ProductSpecifications", "Catalog", new { productId = Model.Id }).ToString()))
                        {

                            <li><a href="#specification" data-toggle="tab">Specifications</a></li>
                        }
                        @if (!String.IsNullOrEmpty(@Html.Action("ProductTags", "Catalog", new { productId = Model.Id }).ToString()))
                        {
                            <li><a href="#tags" data-toggle="tab">Products Tags</a></li>
                        }
                    </ul>


                    <div class="tab-content">
                        @if (!String.IsNullOrEmpty(Model.FullDescription))
                        {
                            <div class="full-description tab-pane active" id="description" itemprop="description">
                                @Html.Raw(Model.FullDescription)
                            </div>
                        }
                        <div class="full-description tab-pane" id="specification">
                            @Html.Action("ProductSpecifications", "Catalog", new { productId = Model.Id })
                        </div>
                        <div class="full-description tab-pane" id="tags">
                            @Html.Action("ProductTags", "Catalog", new { productId = Model.Id })
                        </div>
                    </div>
                </div>




                @Html.Widget("productdetails_before_collateral")
                @Html.Action("ProductTierPrices", "Catalog", new { productId = Model.Id })
            </div>

        }
        @Html.Widget("productdetails_bottom")
    </div>
</div>

<div class="product-collateral">
    
    @Html.Action("ProductsAlsoPurchased", "Catalog", new { productId = Model.Id })
    @Html.Action("RelatedProducts", "Catalog", new { productId = Model.Id })
</div>
